﻿Imports System.Data.SqlClient
Public Class DF59_M
    Inherits Conexion
    Dim cmd As New SqlCommand
    Public Function guardar(ByVal dts As Entidades.EF59_M) As Boolean
        Try
            conectado()
            cmd = New SqlCommand("sp_guardar_F59M")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@numcontrol", dts.numcontroll)
            cmd.Parameters.AddWithValue("@apellido", dts.apellidoo)
            cmd.Parameters.AddWithValue("@nombre", dts.nombree)
            cmd.Parameters.AddWithValue("@doc", dts.docc)
            cmd.Parameters.AddWithValue("@domicilio", dts.domicilioo)
            cmd.Parameters.AddWithValue("@num", dts.numm)
            cmd.Parameters.AddWithValue("@piso", dts.pisoo)
            cmd.Parameters.AddWithValue("@dpto", dts.dptoo)
            cmd.Parameters.AddWithValue("@localidad", dts.localidadd)
            cmd.Parameters.AddWithValue("@provincia", dts.provinciaa)
            cmd.Parameters.AddWithValue("@codpostal", dts.codpostall)
            cmd.Parameters.AddWithValue("@matricula", dts.matriculaa)
            cmd.Parameters.AddWithValue("@matriculamand", dts.matriculamandd)
            cmd.Parameters.AddWithValue("@dominio", dts.dominioo)
            cmd.Parameters.AddWithValue("@tramite", dts.tramitee)
            cmd.Parameters.AddWithValue("@solicitudtipo", dts.solicitudtipoo)
            cmd.Parameters.AddWithValue("@numerocontrol", dts.numerocontroll)
            cmd.Parameters.AddWithValue("@observaciones", dts.observacioness)

            If cmd.ExecuteNonQuery Then
                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        desconectado()
    End Function

    Public Function modificar(ByVal dts As Entidades.EF59_M) As Boolean
        Try
            conectado()
            cmd = New SqlCommand("sp_editar_F59M")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@numcontrol", dts.numcontroll)
            cmd.Parameters.AddWithValue("@apellido", dts.apellidoo)
            cmd.Parameters.AddWithValue("@nombre", dts.nombree)
            cmd.Parameters.AddWithValue("@doc", dts.docc)
            cmd.Parameters.AddWithValue("@domicilio", dts.domicilioo)
            cmd.Parameters.AddWithValue("@num", dts.numm)
            cmd.Parameters.AddWithValue("@piso", dts.pisoo)
            cmd.Parameters.AddWithValue("@dpto", dts.dptoo)
            cmd.Parameters.AddWithValue("@localidad", dts.localidadd)
            cmd.Parameters.AddWithValue("@provincia", dts.provinciaa)
            cmd.Parameters.AddWithValue("@codpostal", dts.codpostall)
            cmd.Parameters.AddWithValue("@matricula", dts.matriculaa)
            cmd.Parameters.AddWithValue("@matriculamand", dts.matriculamandd)
            cmd.Parameters.AddWithValue("@dominio", dts.dominioo)
            cmd.Parameters.AddWithValue("@tramite", dts.tramitee)
            cmd.Parameters.AddWithValue("@solicitudtipo", dts.solicitudtipoo)
            cmd.Parameters.AddWithValue("@numerocontrol", dts.numerocontroll)
            cmd.Parameters.AddWithValue("@observaciones", dts.observacioness)

            If cmd.ExecuteNonQuery Then
                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        desconectado()
    End Function
End Class
